<?php
class IndexAction extends runAction{
	public function index(){
		$this->display();
	}
	public function _main() {
		
		$o = M('news');
		
		$dbsize = 0;
		$r = mysql_query ( 'SHOW TABLE STATUS' );
		while ( $row = mysql_fetch_array ( $r, MYSQL_ASSOC ) ) {
			$dbsize += $row ['Data_length'] + $row ['Index_length'];
		}
		if ($dbsize >= 1073741824) {
			$dbsize = round ( $dbsize / 1073741824 * 100 ) / 100 . ' G';
		} elseif ($dbsize >= 1048576) {
			$dbsize = round ( $dbsize / 1048576 * 100 ) / 100 . ' M';
		} elseif ($dbsize >= 1024) {
			$dbsize = round ( $dbsize / 1024 * 100 ) / 100 . ' K';
		} else {
			$dbsize = $dbsize . ' bytes';
		}
		
		$info = array(
            '操作系统'		=> PHP_OS,
			'运行环境'		=> $_SERVER["SERVER_SOFTWARE"],
			'PHP运行方式'	=> php_sapi_name(),
			'服务器域名/IP'	=> $_SERVER['SERVER_NAME'].' [ '.gethostbyname($_SERVER['SERVER_NAME']).' ]',
			'上传附件限制'	=> ini_get('upload_max_filesize'),
			'执行时间限制'	=> ini_get('max_execution_time').'秒',
			'剩余空间'		=> round((@disk_free_space(".")/(1024*1024)),2).'M',
			'MySQL版本'		=> mysql_get_server_info(),
			'当前数据库尺寸'	=> $dbsize,			
		);
		
		$this->assign ( 'info', $info );
		$this->display();
	}
	public function _left() {
		
		import ( 'app.ORG.sort' );
		
		$this->display();
	}
}
?>